feat(coprocessor): add cargo-llvm-cov code coverage to Rust CI workflows#2086
feat(coprocessor): add cargo-llvm-cov code coverage to Rust CI workflows#2086
Conversation
|
@claude /pr-review |
|
Claude finished @Eikix's task in 8m 8s —— View job [AUTOMATED] PR Review: feat(ci): add cargo-llvm-cov code coverage to Rust CI workflows
SummaryGood initiative adding LLVM source-based coverage instrumentation to the Rust CI workflows. The approach of replacing 🔴 Issue 1: Coverage thresholds are dead code — never enforcedFiles: The The only effect of this file today is triggering CI re-runs when the JSON changes — which does nothing useful since the thresholds aren't enforced. The PR description mentions this is "for future enforcement," which is fine — but I'd recommend either:
Also, the PR description states thresholds of "40%/50%/60%" but the actual file has all three set to 🟡 Issue 2: Coverage profile inherits
|
…age only on coprocessor
1803cc8 to
af7a1fd
Compare
|
@claude /pr-review |
|
Claude finished @Eikix's task in 7m 25s —— View job [AUTOMATED] PR Review: feat(coprocessor): add cargo-llvm-cov code coverage to Rust CI workflows
SummaryClean, well-structured CI change that replaces I ran three parallel review agents (2× bug hunter, 1× error handling auditor) and validated all findings:
🟢 No Blocking IssuesNit:
|
| Aspect | Assessment |
|---|---|
| Pinned action SHAs | taiki-e/install-action@a37010ded... properly pinned with version comment |
| Cache key isolation | cargo-coverage- prefix prevents pollution between coverage and release builds |
| Coverage profile | opt-level = 1, debug = 1, lto = false — good balance of accuracy vs compile time |
| Non-blocking summary | Coverage printed to job summary without failing the build — appropriate for rollout |
if: always() on summary |
Correct pattern — shows coverage data even when tests fail, without masking failures |
rust-toolchain.toml |
llvm-tools-preview component enables local cargo llvm-cov usage too |
| Toolchain pinning | Changed from stable to "1.91.1" — matches rust-toolchain.toml, good for reproducibility |
Previous Review Items — Status
The earlier review raised several issues. Here's where they stand after the author's subsequent commits:
| # | Previous Issue | Status |
|---|---|---|
| 1 | Coverage thresholds are dead code | ✅ Fixed — ci/coverage-thresholds.json removed in af7a1fdc |
| 2 | Coverage profile inherits opt-level = 3 |
✅ Fixed — now uses opt-level = 1 in af7a1fdc |
| 3 | 2>/dev/null swallows errors |
⚪ Nit — kept as-is, acceptable for initial rollout (see above) |
| 4 | DB connection hang risk | ⚪ Not a real issue — cargo llvm-cov report reads profiling data from disk, doesn't connect to DB |
LGTM — this is ready to merge. 🚀
🧪 CI InsightsHere's what we observed from your CI run for b610ebf. 🟢 All jobs passed!But CI Insights is watching 👀 |
1422c9c to
4ea96e1
Compare
|
@claude /pr-review |
There was a problem hiding this comment.
[AUTOMATED]
Code Review — PR #2086
Summary
This PR adds cargo-llvm-cov code coverage instrumentation to the coprocessor Rust CI workflow. It replaces cargo test --release with cargo llvm-cov using a new [profile.coverage] Cargo profile, and writes coverage results to the GitHub Actions job summary.
Files reviewed:
.github/workflows/coprocessor-cargo-tests.yml— CI workflow changescoprocessor/fhevm-engine/Cargo.toml— New[profile.coverage]sectioncoprocessor/fhevm-engine/rust-toolchain.toml— Addedllvm-tools-previewcomponent
What looks good
- Actions are properly pinned to SHA hashes (
taiki-e/install-action,dtolnay/rust-toolchain) - Cache key updated to avoid conflicts with old release-profile artifacts
- The
[profile.coverage]sensibly inherits fromreleasewithdebug = 1for source mapping and reducedopt-levelfor better instrumentation accuracy - Test step correctly does not have
|| true, so test failures will still fail the workflow - The
if: always()on the report step is appropriate for informational output rust-toolchain.tomlchange is consistent with the workflow toolchain pin
Issues found: 2 (non-blocking)
See inline comments below.
|
The review has been posted successfully. Here's a summary of what was done: Review Complete ✅I posted a code review on PR #2086 with: Review Summary (COMMENT — non-blocking)The PR is a solid CI enhancement that adds code coverage instrumentation. All actions are properly SHA-pinned, the coverage profile is well-configured, and test failures correctly propagate to fail the workflow. 2 Non-blocking Inline Comments (Nits)
Validated Non-Issues
|
|
@claude /pr-review |
There was a problem hiding this comment.
[AUTOMATED]
Code Review
Overall this is a clean, well-structured PR that adds code coverage instrumentation to the Rust CI workflow. The action pinning, cache key separation, profile configuration, and rust-toolchain.toml changes all follow established project conventions. One issue found below.
Checked for: bugs, guideline compliance, error handling.
|
The review has been posted successfully. Here's a summary of the review: Review Summary for PR #2086PR: feat(coprocessor): add cargo-llvm-cov code coverage to Rust CI workflows What was checked
Findings1 validated issue posted:
What passed review
|
Summary
cargo-llvm-cov(LLVM source-based instrumentation) to all 3 Rust CI test workflows: coprocessor, kms-connector, and sdk/rust-sdkcargo test(not in addition to it) so overhead is minimal (~10-20% compile time)ci/coverage-thresholds.json(40%/50%/60%) for future enforcementRelated: https://github.com/zama-ai/fhevm-internal/issues/1146